﻿<ad:DockableContent x:Class="Renci.iRods.Studio.Modules.Explorer.Views.ExplorerDockableView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
             xmlns:controls="clr-namespace:Renci.iRods.Studio.Modules.Explorer.Controls"
             mc:Ignorable="d"
             Title="Explorer">
    <ad:DockableContent.Resources>
        <ResourceDictionary Source="/Renci.iRods.Studio.Modules.Explorer;component/Resources/Dictionary.xaml" />
    </ad:DockableContent.Resources>

    <Grid>
        <controls:TreeListView Model="{Binding Model}" SelectedObject="{Binding SelectedItem, Mode=OneWayToSource}">

            <controls:TreeListView.Resources>
                <ContextMenu x:Key="ItemContextMenu" ItemsSource="{Binding Tag.ContextCommands}" ItemContainerStyle="{StaticResource ContextMenuItemStyle}" />
            </controls:TreeListView.Resources>

            <controls:TreeListView.ItemContainerStyle>
                <Style TargetType="{x:Type ListViewItem}">
                    <Setter Property="ContextMenu" Value="{StaticResource ItemContextMenu}"/>
                </Style>
            </controls:TreeListView.ItemContainerStyle>

            <controls:TreeListView.View>
                <GridView>
                    <GridView.Columns>
                        <GridViewColumn Width="400" Header="Name">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <controls:TreeListViewRowExpander />
                                        <TextBlock Text="{Binding Name}"></TextBlock>
                                    </StackPanel>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Header="Type" Width="50" DisplayMemberBinding="{Binding TypeName}"/>
                        <GridViewColumn Header="Size" Width="50" DisplayMemberBinding="{Binding Size}"/>
                        <GridViewColumn Header="Owner Name" Width="50" DisplayMemberBinding="{Binding OwnerName}"/>
                        <GridViewColumn Header="Owner Zone" Width="50" DisplayMemberBinding="{Binding OwnerZone}"/>
                        <GridViewColumn Header="Creation Time" Width="50" DisplayMemberBinding="{Binding CreationTime}"/>
                        <GridViewColumn Header="Modified Time" Width="50" DisplayMemberBinding="{Binding LastWriteTime}"/>
                    </GridView.Columns>
                </GridView>
            </controls:TreeListView.View>
        </controls:TreeListView>
    </Grid>
</ad:DockableContent>